package com.ysm.smfu.food;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ysm.smfu.R;
import com.ysm.smfu.activity.BaseActivity;
import com.ysm.smfu.bean.FoodTuanGou;
import com.ysm.smfu.food.holder.FoodOrderDetailHolder;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 查看团购券
 */
public class FoodOrderDetailActivity extends BaseActivity {

    @BindView(R.id.back)
    ImageView back;
    @BindView(R.id.title)
    TextView title;
    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;

    List<FoodTuanGou> datas = new ArrayList<>();

    @Override
    protected void initViews() {
        super.initViews();
        setContentView(R.layout.activity_food_order_detail);
        ButterKnife.bind(this);
        title.setText("团购券");
    }

    @Override
    protected void initListener() {
        super.initListener();
        getData();
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
        recyclerView.setLayoutManager(linearLayoutManager);
        MyAdapter myAdapter = new MyAdapter(datas);
        recyclerView.setAdapter(myAdapter);
    }

    @OnClick({R.id.back})
    public void onclick(View view) {
        switch (view.getId()) {
            case R.id.back:
                finish();
                break;
        }
    }

    private class MyAdapter extends BaseQuickAdapter<FoodTuanGou, FoodOrderDetailHolder> {
        public MyAdapter(List<FoodTuanGou> data) {
            super(R.layout.activity_food_orderdetail, data);
        }

        @Override
        protected void convert(FoodOrderDetailHolder helper, FoodTuanGou item) {

        }
    }

    public void getData() {
        FoodTuanGou foodTuanGou = new FoodTuanGou();
        datas.add(foodTuanGou);
        datas.add(foodTuanGou);
    }
}
